package cn.wolfcode.shop.cloud.util;


import org.apache.commons.codec.digest.DigestUtils;

import java.util.UUID;

public class MD5Util {

    public static String encode(String password,String salt){
        String pass = ""+ salt.charAt(0) +salt.charAt(3) + password + salt.charAt(2) + salt.charAt(4);
        return DigestUtils.md5Hex(pass);
    }

    public static void main(String[] args) {
        String salt = UUID.randomUUID().toString().replace("-","").substring(0,5);
        System.out.println(salt);
        System.out.println(encode("11111", salt));
    }
}
